﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.PrilagodenDokumentTip"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class PrilagodenDokumentTipEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// ComboBox for the IDDokumentTip property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDDokumentTip;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDDokumentTip property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDDokumentTipLabel;
		
		/// <summary>
		/// TextBox for the Naziv property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxNaziv;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Naziv property.
		/// </summary>
		protected System.Windows.Forms.Label uxNazivLabel;
		
		/// <summary>
		/// TextBox for the SkraceniNaziv property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxSkraceniNaziv;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the SkraceniNaziv property.
		/// </summary>
		protected System.Windows.Forms.Label uxSkraceniNazivLabel;
		
		/// <summary>
		/// TextBox for the Parametar1 property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxParametar1;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Parametar1 property.
		/// </summary>
		protected System.Windows.Forms.Label uxParametar1Label;
		
		/// <summary>
		/// TextBox for the Parametar2 property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxParametar2;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Parametar2 property.
		/// </summary>
		protected System.Windows.Forms.Label uxParametar2Label;
		
		/// <summary>
		/// TextBox for the Parametar3 property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxParametar3;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Parametar3 property.
		/// </summary>
		protected System.Windows.Forms.Label uxParametar3Label;
		#endregion
		
		#region Main entity
		private Entities.PrilagodenDokumentTip _PrilagodenDokumentTip;
		/// <summary>
		/// Gets or sets the <see cref="Entities.PrilagodenDokumentTip"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.PrilagodenDokumentTip"/> instance.</value>
		public Entities.PrilagodenDokumentTip PrilagodenDokumentTip
		{
			get {return this._PrilagodenDokumentTip;}
			set
			{
				this._PrilagodenDokumentTip = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxIDDokumentTip.DataBindings.Clear();
			this.uxIDDokumentTip.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDDokumentTip", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxNaziv.DataBindings.Clear();
			this.uxNaziv.DataBindings.Add("Text", this.uxBindingSource, "Naziv", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxSkraceniNaziv.DataBindings.Clear();
			this.uxSkraceniNaziv.DataBindings.Add("Text", this.uxBindingSource, "SkraceniNaziv", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxParametar1.DataBindings.Clear();
			this.uxParametar1.DataBindings.Add("Text", this.uxBindingSource, "Parametar1", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxParametar2.DataBindings.Clear();
			this.uxParametar2.DataBindings.Add("Text", this.uxBindingSource, "Parametar2", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxParametar3.DataBindings.Clear();
			this.uxParametar3.DataBindings.Add("Text", this.uxBindingSource, "Parametar3", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="PrilagodenDokumentTipEditControlBase"/> class.
		/// </summary>
		public PrilagodenDokumentTipEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_PrilagodenDokumentTip != null) _PrilagodenDokumentTip.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxIDDokumentTip = new System.Windows.Forms.ComboBox();
			uxIDDokumentTipLabel = new System.Windows.Forms.Label();
			this.uxNaziv = new System.Windows.Forms.TextBox();
			uxNazivLabel = new System.Windows.Forms.Label();
			this.uxSkraceniNaziv = new System.Windows.Forms.TextBox();
			uxSkraceniNazivLabel = new System.Windows.Forms.Label();
			this.uxParametar1 = new System.Windows.Forms.TextBox();
			uxParametar1Label = new System.Windows.Forms.Label();
			this.uxParametar2 = new System.Windows.Forms.TextBox();
			uxParametar2Label = new System.Windows.Forms.Label();
			this.uxParametar3 = new System.Windows.Forms.TextBox();
			uxParametar3Label = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIDDokumentTipLabel
			//
			this.uxIDDokumentTipLabel.Text = "IDDokumentTip:";
			this.uxIDDokumentTipLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIDDokumentTipLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDDokumentTipLabel);			
			//
			// uxIDDokumentTip
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDDokumentTip);
			this.uxIDDokumentTip.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxIDDokumentTip);
			//
			// uxNazivLabel
			//
			this.uxNazivLabel.Text = "Naziv:";
			this.uxNazivLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxNazivLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxNazivLabel);			
			//
			// uxNaziv
			//
			this.uxNaziv.Width = 250;
			this.uxNaziv.MaxLength = 200;
			//this.uxTableLayoutPanel.Controls.Add(this.uxNaziv);
			this.uxNaziv.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxNaziv);
			//
			// uxSkraceniNazivLabel
			//
			this.uxSkraceniNazivLabel.Text = "SkraceniNaziv:";
			this.uxSkraceniNazivLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxSkraceniNazivLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxSkraceniNazivLabel);			
			//
			// uxSkraceniNaziv
			//
			this.uxSkraceniNaziv.Width = 250;
			this.uxSkraceniNaziv.MaxLength = 10;
			//this.uxTableLayoutPanel.Controls.Add(this.uxSkraceniNaziv);
			this.uxSkraceniNaziv.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxSkraceniNaziv);
			//
			// uxParametar1Label
			//
			this.uxParametar1Label.Text = "Parametar1:";
			this.uxParametar1Label.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxParametar1Label);
			//this.uxTableLayoutPanel.Controls.Add(this.uxParametar1Label);			
			//
			// uxParametar1
			//
			this.uxParametar1.Width = 250;
			this.uxParametar1.MaxLength = 400;
			//this.uxTableLayoutPanel.Controls.Add(this.uxParametar1);
			this.uxParametar1.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxParametar1);
			//
			// uxParametar2Label
			//
			this.uxParametar2Label.Text = "Parametar2:";
			this.uxParametar2Label.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxParametar2Label);
			//this.uxTableLayoutPanel.Controls.Add(this.uxParametar2Label);			
			//
			// uxParametar2
			//
			this.uxParametar2.Width = 250;
			this.uxParametar2.MaxLength = 400;
			//this.uxTableLayoutPanel.Controls.Add(this.uxParametar2);
			this.uxParametar2.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxParametar2);
			//
			// uxParametar3Label
			//
			this.uxParametar3Label.Text = "Parametar3:";
			this.uxParametar3Label.Location = new System.Drawing.Point(3, 130);
			this.Controls.Add(this.uxParametar3Label);
			//this.uxTableLayoutPanel.Controls.Add(this.uxParametar3Label);			
			//
			// uxParametar3
			//
			this.uxParametar3.Width = 250;
			this.uxParametar3.MaxLength = 400;
			//this.uxTableLayoutPanel.Controls.Add(this.uxParametar3);
			this.uxParametar3.Location = new System.Drawing.Point(160, 130);
			this.Controls.Add(this.uxParametar3);
			//
			// uxIDDokumentTip
			//				
			this.uxIDDokumentTip.DisplayMember = "Naziv";	
			this.uxIDDokumentTip.ValueMember = "ID";	
			// 
			// PrilagodenDokumentTipEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "PrilagodenDokumentTipEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
				
		private Entities.TList<Entities.DokumentTip> _IDDokumentTipList;
		
		/// <summary>
		/// The ComboBox associated with the IDDokumentTip property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.DokumentTip> IDDokumentTipList
		{
			get {return _IDDokumentTipList;}
			set 
			{
				this._IDDokumentTipList = value;
				this.uxIDDokumentTip.DataSource = null;
				this.uxIDDokumentTip.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDDokumentTipList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDDokumentTip property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDDokumentTipList
		{
			get { return _allowNewItemInIDDokumentTipList;}
			set
			{
				this._allowNewItemInIDDokumentTipList = value;
				this.uxIDDokumentTip.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
